<template>
  <div class="btCon">
    <div class="bt-cool">
      <div class="up" :style="styleObj"></div>
      <div class="down" :style="styleObj"></div>
      <span>{{ title }} </span>
    </div>
  </div>
</template>
<script lang="ts">
import { computed, defineComponent, ref } from "vue";
export default defineComponent({
  props: {
    title: {
      type: String,
      default: "Read More",
    },
    color: {
      type: String,
      default: "#e74c3c",
    },
  },
  setup(props) {
    const styleObj = computed(() => {
      return {
        background: props.color,
        boxShadow: `0 0 5px ${props.color}, 0 0 15px ${props.color}, 0 0 30px ${props.color},0 0 60px ${props.color}`,
      };
    });

    return { styleObj };
  },
});
</script>
<style lang="scss" scoped>
.btCon {
  width: 12.5rem;
  display: inline-flex;
  justify-content: center;
  .bt-cool {
    display: inline-block;
    height: 3rem;
    position: relative;
    span {
      padding: 0 1.5rem;
      white-space: nowrap;
      color: #fff;
      cursor: pointer;
      font-size: 1rem;
      text-decoration: none;
      height: 100%;
      width: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      background: rgba(255, 255, 255, 0.05);
      box-shadow: 0px 0.75rem 1.75rem rgba($color: #000000, $alpha: 0.2);
      border-top: 1px solid rgba(255, 255, 255, 0.1);
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 2rem;
      z-index: 1;
      font-weight: 400;
      letter-spacing: 1px;
      transition: 0.5s;
      position: relative;
      overflow: hidden;
      backdrop-filter: blur(0.75rem);
      &::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 50%;
        height: 100%;
        background-image: linear-gradient(
          to left,
          rgba(255, 255, 255, 0.12),
          transparent
        );
        transition: 0.5s;
        transform: skewX(45deg) translateX(0);
      }
    }
    .up {
      position: absolute;
      bottom: -0.25rem;
      left: 50%;
      transform: translateX(-50%);
      width: 1.5rem;
      height: 0.5rem;
      border-radius: 0.5rem;
      transition: 0.3s;
      transition-delay: 0.3s;
    }
    .down {
      position: absolute;
      top: -0.25rem;
      left: 50%;
      transform: translateX(-50%);
      width: 1.5rem;
      height: 0.5rem;
      border-radius: 0.5rem;
      transition: 0.3s;
      transition-delay: 0.3s;
    }
    &:hover {
      span {
        letter-spacing: 3px;
      }
      span::before {
        transform: skewX(45deg) translateX(200%);
      }

      .up {
        bottom: 3px;
        height: 50%;
        width: 90%;
        border-radius: 1.5rem;
      }
      .down {
        top: 3px;
        height: 50%;
        width: 90%;
        border-radius: 30px;
      }
    }
  }
}
</style>
